<?php if (!defined('THINK_PATH')) exit();?><div class="bjui-pageHeader">
    <div class="pull-right">
        <button class="btn-default" data-icon="refresh" onclick="$.CurrentNavtab.navtab('refresh')"></button>
    </div>
</div>
<div class="bjui-pageContent">
    <form action="<?php echo U('save_wmk');?>" data-toggle="validate" data-alertmsg="false" class="navtabForm">
        <div class="form-group">
            <label class="x100">商品图片加水印:</label>
            <input type="radio" name="wmk_status" value="0" id="wmk-add1" data-toggle="icheck" data-label="开启" <?php if($va["wmk_status"] == '0' or $va["wmk_status"] == null): ?>checked<?php endif; ?>/>
            <input type="radio" name="wmk_status" value="1" id="wmk-add2" data-toggle="icheck" data-label="关闭" <?php if($va["wmk_status"] == '1'): ?>checked<?php endif; ?>  />
        </div>
        <div class="form-group select-wmk-type">
            <label class="x100">水印类型:</label>
            <input type="radio" name="wmk_type" id="wmk-type1" value="1" data-toggle="icheck" data-label="文字"   <?php if($va["wmk_type"] == '1'): ?>checked<?php endif; ?> />
            <input type="radio" name="wmk_type" id="wmk-type2" value="2" data-toggle="icheck" data-label="图片" <?php if($va["wmk_type"] != '1'): ?>checked<?php endif; ?> />
        </div>
        <div class="form-group clearfix type-image" <?php if($va["wmk_type"] == '1'): ?>style="display: none;"<?php endif; ?>>
            <label class="x100 pull-left">水印图片:</label>
            <div class="pull-left parent_img">
            <?php if($va["wmk_photo"] == null): ?><img src="http://www.bxd.com/Public/images/58008889b30bc.jpg" alt="LOGO" width="70" />
            <?php else: ?>
                 <img src="<?php echo ($va["wmk_photo"]); ?>" alt="LOGO" width="70" /><?php endif; ?>
                <input type="hidden" name="wmk_photo" value="<?php echo ($va["wmk_photo"]); ?>"/>
                <span data-toggle="upload"
                      data-uploader="<?php echo U('Index/upload');?>"
                      data-file-type-exts="*.png;*.jpg"
                      data-icon="cloud-upload"
                      data-on-upload-success="upload_callback"
                      data-auto="true"
                      data-button-text="上传图片"
                ></span>
            </div>
        </div>
        <div class="form-group type-wrt" <?php if($va["wmk_type"] != '1'): ?>style="display: none;"<?php endif; ?>>
            <label class="x100">水印文字:</label>
            <input type="text" name="wmk_text"  value="<?php echo ($va["wmk_text"]); ?>"/>
        </div>
        <!-- <div class="form-group">
       <label class="x100">水印大小:</label>
            宽:<input type="text" name="" value="100" data-rule="required" class="w100" />
            高:<input type="text" name="" value="100" data-rule="required" class="w100" />
            <span class="text-warning">单位:象素(px)</span>
        </div> -->
        <div class="form-group">
            <label class="x100">水印透明度:</label>
            <input type="text" name="wmk_alpha" class="w60" value="<?php echo ($va['wmk_alpha']?$va['wmk_alpha']:'80'); ?>" data-toggle="spinner" data-min="0" data-max="100" data-step="1" data-rule="integer" />
            <span class="text-warning">0代表完全透明，100代表不透明</span>
        </div>
       <!--  <div class="form-group">
            <label class="x100">水印质量:</label>
            <input type="text" name="mass" class="w60" value="50" data-toggle="spinner" data-min="0" data-max="100" data-step="1" data-rule="integer" />
            <span class="text-warning">设置为0-100之间的数字,决定 jpg 格式图片的质量</span>
        </div> -->
        <div class="form-group clearfix">
            <label class="x100 pull-left text-top">水印位置:</label>
            <div class="pull-left">
                <p>
                    <input type="radio" name="wmk_seat" data-toggle="icheck" data-label="左上角"   value="1" <?php if($va["wmk_seat"] == '1' or $va["wmk_seat"] == null): ?>checked<?php endif; ?>/>
                    <input type="radio" name="wmk_seat" data-toggle="icheck" data-label="上居中"   value="2" <?php if($va["wmk_seat"] == '2'): ?>checked<?php endif; ?>/>
                    <input type="radio" name="wmk_seat" data-toggle="icheck" data-label="右上角"   value="3" <?php if($va["wmk_seat"] == '3'): ?>checked<?php endif; ?>/>
                </p>
                <p>
                    <input type="radio" name="wmk_seat" data-toggle="icheck" data-label="左居中"   value="4" <?php if($va["wmk_seat"] == '4'): ?>checked<?php endif; ?>/>
                    <input type="radio" name="wmk_seat" data-toggle="icheck" data-label="中心点" value="5"  <?php if($va["wmk_seat"] == '5'): ?>checked<?php endif; ?>/>
                    <input type="radio" name="wmk_seat" data-toggle="icheck" data-label="右居中"  value="6" <?php if($va["wmk_seat"] == '6'): ?>checked<?php endif; ?>/>
                </p>
                <p>
                    <input type="radio" name="wmk_seat" data-toggle="icheck" data-label="左下角"  value="7" <?php if($va["wmk_seat"] == '7'): ?>checked<?php endif; ?>/>
                    <input type="radio" name="wmk_seat" data-toggle="icheck" data-label="下居中"  value="8" <?php if($va["wmk_seat"] == '8'): ?>checked<?php endif; ?>/>
                    <input type="radio" name="wmk_seat" data-toggle="icheck" data-label="右下角"  value="9" <?php if($va["wmk_seat"] == '9'): ?>checked<?php endif; ?>/>
                </p>

            </div>
        </div>
    </form>
</div>
<script>
    $(function () {
        $('input[name="wmk_type"]').on('ifChanged', function (e) {
            var checked = $(this).is(':checked'),
                    val = $(this).val();
            if( checked ){
                if( val == 1 ){
                    $('.type-wrt').show();
                    $('.type-image').hide();
                }else {
                    $('.type-wrt').hide();
                    $('.type-image').show();
                }
            }
        });
    });
</script>

<div class="bjui-pageFooter">
		
	<?php if(save == save): ?><ul>
			<li><button type="submit" class="btn-default" data-icon="save">保存</button></li>
	        <li><button type="button" class="btn-close" data-icon="close">关闭</button></li>
	    </ul>
	<?php elseif(save == close): ?>
	    <ul>
	        <li><button type="button" class="btn-close" data-icon="close">关闭</button></li>
	    </ul>
	<?php elseif(save == page and $show != null): ?>
		<ul>
	        <li><button type="button" class="btn-close" data-icon="close">关闭</button></li>
	    </ul>
		    <div class="pages">
		        <span>每页&nbsp;</span>
		        <div class="selectPagesize">
		            <select data-toggle="selectpicker" data-toggle-change="changepagesize">
		                <option value="<?php echo ($show['listrow']); ?>"><?php echo ($show['listrow']); ?></option>
		                <option value="60">60</option>
		                <option value="120">120</option>
		                <option value="150">150</option>
		            </select>
		        </div>
		        <span>&nbsp;条，共 <?php echo ($show['total']); ?> 条</span>
		    </div>
		    <div class="pagination-box" data-toggle="pagination" data-total="<?php echo ($show['total']); ?>" data-page-size="<?php echo ($show['listrow']); ?>" data-page-current="1">
		    </div>
	<?php elseif(save == page and $show == null): ?>
		<ul>
			<li><button type="button" class="btn-close" data-icon="close">关闭</button></li>
		</ul>
	<?php else: ?>
		<ul>
			<li><button type="button" class="btn-close" data-icon="close">关闭</button></li>
		</ul><?php endif; ?>

</div>